package com.xmall.product.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xmall.define.dto.es.EsSkuDto;
import com.xmall.product.define.dto.spu.SpuInfoDto;
import com.xmall.product.define.dto.spu.SpuResponseDto;
import com.xmall.product.define.request.spu.SpuListPageQueryRequest;
import com.xmall.product.define.request.spu.SpuUpdateRequest;
import com.xmall.product.entity.SpuInfo;

import java.util.List;

/**
 * <p>
 * 商品spu信息 服务类
 * </p>
 *
 * @author xmall
 * @since 2023-11-02
 */
public interface ISpuInfoService extends IService<SpuInfo> {

    /**
     * 新增
     */
    void saveEntity(SpuUpdateRequest request);

    /**
     * 编辑
     */
    void updateEntity(SpuUpdateRequest request);

    /**
     * 删除
     */
    void deleteEntity(Long id);

    /**
     * 构造es对象
     */
    List<EsSkuDto> buildEsSku(Long spuId, Integer esVersion);

    /**
     * 分页列表
     */
    Page<SpuInfoDto> listPage(SpuListPageQueryRequest request);

    /**
     * 详情
     */
    SpuResponseDto info(Long id) throws Exception;

    /**
     * 详情
     */
    SpuResponseDto apiInfo(Long id) throws Exception;

}
